<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>title</title>
  <script src="../vue.js"></script>
</head>
<body>
<div id="app">

  <h1>{{msg}}</h1>
  <button style="width: 100px;margin-left: 10px;font-size: 24px" @click="haveAccount = true">登录</button>
  <button style="width: 100px;margin-left: 10px;font-size: 24px" @click="haveAccount = false">注册</button>
  <div v-if="haveAccount" key="login">
    <span>账号:</span><input type="text" name="username" placeholder="请输入账号">
    <span>密码:</span><input type="password" name="password" placeholder="请输入密码">
  </div>
  <div v-else key="register">
    <span>账号:</span><input type="text" name="username" placeholder="注册新账号">
    <span>密码:</span><input type="password" name="password" placeholder="请输入您确定您的登录密码">
  </div>

</div>

<script>
  Vue.config.productionTip = false;
  const vm = new Vue({
    el:'#app',
    data(){
      return{
        msg:'欢迎来到英雄联盟~~!',
        haveAccount:false
      }
    }
  })
</script>

</body>
</html>